package com.service.business.member.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.service.business.member.controller.rep.MemberAccumulatedRep;
import com.service.business.member.controller.rep.MemberJARep;
import com.service.business.member.dto.MiningRecord;
import com.service.core.rest.request.PageRequest;
import com.service.core.rest.response.CommonPageRep;
import com.service.dao.dto.HrComboOrder;
import com.service.dao.enums.CoinsEnum;
import com.service.dao.model.JournalAccount;
import com.service.dao.model.MemberOut;
import com.service.dao.po.MemberCache;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Set;

/**
 * <dl>
 * <dt>back-end</dt>
 * <dd>Description:</dd>
 * <dd>Copyright: Copyright (C) 2015</dd>
 * <dd>Company: </dd>
 * <dd>CreateDate: 2019年09月24日</dd>
 * </dl>
 *
 * @author
 */
public interface MemberJAService extends IService<JournalAccount> {

	MemberAccumulatedRep getTotalAccumulated();

	CommonPageRep<MemberJARep> pageAccumulated(CoinsEnum coin, PageRequest request);

	CommonPageRep<MemberJARep> pageMemberJA(CoinsEnum coin, PageRequest request);

	CommonPageRep<MemberJARep> pageMemberJA(CoinsEnum coin, Integer orderId, PageRequest request);

	void getMemberIncome(Integer memberId, MemberCache.MemberCacheBuilder builder, MemberOut memberOut);

	List<MiningRecord> getMiningRecord(Integer memberId, Integer orderId);

	BigDecimal getSomedayTotalStatement(Integer storeId, Date someday, List<Integer> jaType);

	BigDecimal getSomedayTotalStatement(Integer memberId, String coinsName, Date someday, List<Integer> jaType);

	/**
	 * @Description: 统计用户流水总量
	 * @Author: ty
	 * @Date: 2021/4/30 15:38
	 * @param: [memberId, typeList]
	 * @return: java.math.BigDecimal
	 **/
	BigDecimal totalMemberStatement(Integer memberId, List<Integer> typeList,Date someDay);

	/**
	 * @Description: 统计本月业绩 排除代理商和分公司伞下业绩
	 * @Author: ty
	 * @Date: 2021/5/6 15:36
	 * @param: [memberIds, currentMonth]
	 * @return: java.math.BigDecimal
	 **/
	BigDecimal totalPerformanceCurrentMonth(Set<Integer> memberIds, Date currentMonth);

	/**
	 * @Description: 判断用户的某天某流水是否存在
	 * @Author: ty
	 * @Date: 2021/5/28 14:17
	 * @param: [memberId, someday, typeList]
	 * @return: java.lang.Integer
	 **/
	Integer checkByMemberAndTypeAndSomeday(Integer memberId, String someday, List<Integer> typeList);

	/**
	 * @Description: 支付算力订单直推 业绩分红
	 * @Author: ty
	 * @Date: 2021/6/24 15:01
	 * @param: [payOrder]
	 * @return: void
	 **/
	void dealMemberAward(HrComboOrder payOrder);
}
